//
//  MyTestCell.m
//  MIDI
//
//  Created by E.M.Game on 15/9/16.
//  Copyright (c) 2015年 QXSX. All rights reserved.
//

#import "MyTestCell.h"
#import "CommFunc.h"

@implementation MyTestCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
//    [super setSelected:selected animated:animated];
//
//    // Configure the view for the selected state
}

- (id)loadFromNib
{
    NSString *nibName = NSStringFromClass([self class]);
    return [[[NSBundle mainBundle] loadNibNamed:nibName owner:nil options:nil] firstObject];
}

-(int)getHeight
{
    int height1 = [CommFunc sizeWithString:self.testAddrLabel.text
                                     font:[UIFont fontWithName:@"Hiragino Sans GB" size:12]
                                      max:CGSizeMake(self.testAddrLabel.frame.size.width, MAXFLOAT)].height;
    
    int height2 = [CommFunc sizeWithString:self.testTimeLabel.text
                                      font:[UIFont fontWithName:@"Hiragino Sans GB" size:12]
                                       max:CGSizeMake(self.testTimeLabel.frame.size.width, MAXFLOAT)].height;
    
    int height = height1 + height2;
    
    if (height <= 0)
        return 120;
    else
    {
        height = self.testAddrLabel.frame.origin.y + height1 + 8 + height2 + 30;
        return height;
    }
    
    return 0;
}


@end





















